package com.LearnInWorld.video.feign;

import com.LearnInWorld.entity.Result;
import com.LearnInWorld.video.pojo.Category;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "LearnInWorld-service-video", contextId = "videoClient")
@RequestMapping("/category")
public interface CategoryFeign {
    /**
     * 查询全部数据
     *
     * @return
     */
    @GetMapping
    public Result findAll();

    /**
     * 根据模块id查询分类信息
     *
     * @param moduleId
     * @return
     */
    @GetMapping("/list")
    public List<Category> findCategoryByModule(@RequestParam("moduleId") Integer moduleId);
}
